import sys

from setuptools import setup

def read_file(file):
    with open(file, "rt") as f:
        return f.read()

# 获取命令行参数
if '-r' in sys.argv:
    index = sys.argv.index('-r')
    requirements_file = sys.argv[index + 1]
    del sys.argv[index:index + 2]
else:
    requirements_file = 'requirements.txt'


setup(
    name="data-report",
    version="1.0.0",
    author="yb",
    author_email="",
    description="数据报告",
    packages=['datareport'],
    url='',
    include_package_data=True,      #启用MANIFEST.in
    install_requires=[i for i in read_file(requirements_file).strip().splitlines() if i != '']
)